<?php
class tejiaModel extends model{
	public $base;
	public function __construct(&$base){
		parent::__construct($base);
		$this->base=$base;
		$this->table="tejia";
	}
	
	public function type_list(){
		return array(
			1=>"只有一次",
			2=>"每天一次"
		);
	}
	
	public function total_num_add($option){
	 
		$shopid=intval($option['shopid']);
		$id=intval($option['id']);
		$total_num=intval($option['total_num']);
		$row=M("tejia")->selectRow("shopid=".$shopid." AND id=".$id."");
		M("shop_product")->update(array(
				"total_num"=>$row['total_num']+$total_num
		),"id=".$row['id']);	
	}
	
}

?>